package com.example.xueshen.common.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.xueshen.common.dao.StudentsMapper;
import com.example.xueshen.common.entity.Students;
import com.example.xueshen.common.service.StudentsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class   StudentsServiceImpl implements StudentsService {
    @Resource
    private StudentsMapper studentsMapper;
    @Override
    public List<Students> selectAllByPlus() {
        return studentsMapper.selectAllByPlus();
    }

    @Override
    public Boolean insert(Students students) {
        return studentsMapper.insert(students)>0;
    }

    @Override
    public int deleteById(Integer id) {
        return 0;
    }

    @Override
    public Students selectById(Integer id) {
        return studentsMapper.selectById(id);
    }

    @Override
    public Boolean updateById(Students students) {
        return studentsMapper.updateById(students)>0;
    }

    @Override
    public int deleteByBanId(Integer id) {
        return studentsMapper.deleteById(id);
    }

    @Override
    public Page<Students> selectAllByPlusAndPage(Page<Students> page) {
        return studentsMapper.selectPage(page, null);
    }

    @Override
    public Page<Students> selectByLike(String name, Page<Students> page) {
        return studentsMapper.selectByLike(name,page);
    }

/*    @Override
    public List<Students> selectByLike(String name) {
        return studentsMapper.selectByLike(name);
    }*/


}
